package logic

import (
	"context"
	"errors"
	"house_srv/models/mysql"

	"house_srv/house"
	"house_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserExamineLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserExamineLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserExamineLogic {
	return &UserExamineLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *UserExamineLogic) UserExamine(in *house.UserExamineRequest) (*house.UserExamineResponse, error) {
	// todo: add your logic here and delete this line
	var user mysql.User
	err := user.UpdateRealName()
	if err != nil {
		logx.Error("用户管理员审核失败")
		return nil, errors.New("用户管理员审核失败")
	}
	return &house.UserExamineResponse{}, nil
}
